package com.example.controller;

import com.example.dto.FileResult;
import com.example.service.FileService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * <p></p>
 * Created by zhezhiyong@163.com on 2018/7/19.
 */
@RestController
public class FileController {

    @Resource
    private FileService fileService;

    @RequestMapping("/pic/upload")
    @ResponseBody
    public FileResult uploadFile(@RequestParam MultipartFile uploadFile) {
        return fileService.uploadPic(uploadFile);
    }

}
